package com.ethan.annotation;

import java.lang.reflect.Method;

/**
 * @author ethan
 * create 2018-08-02 上午9:55
 * desc
 **/
public class AnnotationParser {
    public static void main(String[] args){
        try{
            Class cls = AnnotationTest.class;
            for (Method method : cls.getMethods()) {
                MethodInfo methodInfo = method.getAnnotation(MethodInfo.class);
                if(methodInfo != null ){
                    System.out.println("method name:"+method.getName());
                    System.out.println("method author:" + methodInfo.author());
                    System.out.println("method date:"+ methodInfo.date());
                    System.out.println("method version:"+ methodInfo.version());
                }
            }
        }catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
